# 导包
import pymysql
# 创建连接
conn = pymysql.connect(host='192.168.126.134', port=3306, user='root', password='123456', database='litemall', charset='utf8')
# 创建游标
cursor = conn.cursor()
# 执行SQL语句
try:
    for i in range(10146, 10247):
        sql = f'''INSERT INTO litemall.litemall_address (id, name, user_id, province, city, county, address_detail, area_code, postal_code, tel, is_default, add_time, update_time, deleted) VALUES (null, 'test{i}', {i}, '上海市', '市辖区', '黄浦区', '199', '310101', '', '13666666666', 1, '2025-07-26 14:54:45', '2025-07-26 14:54:45', 0);'''
        cursor.execute(sql)
        conn.commit()
except Exception as e:
    print(e)
    conn.rollback()
# 关闭游标
cursor.close()
# 关闭连接
conn.close()